# U-Boot: Hobbitboard
# Maintainer: Kevin Mihelich <kevin@archlinuxarm.org>

buildarch=4

pkgname=uboot-hobbitboard
pkgver=2016.09
pkgrel=1
pkgdesc="U-Boot for Hobbitboard"
arch=('armv7h')
url="http://git.denx.de/u-boot.git/"
license=('GPL')
makedepends=('git' 'bc')
install=${pkgname}.install
source=("ftp://ftp.denx.de/pub/u-boot/u-boot-${pkgver/rc/-rc}.tar.bz2"
        '0001-arch-linux-arm-modifications.patch')
md5sums=('2e69dda70eb28f8042d2f9fbeb1feaa1'
         '64670947280aafdc26017a79bad368db')

prepare() {
  cd u-boot-${pkgver/rc/-rc}
  git apply ../0001-arch-linux-arm-modifications.patch
}

build() {
  cd u-boot-${pkgver/rc/-rc}

  unset LDFLAGS CFLAGS CXXFLAGS

  make distclean 
  make pico-imx6ul_config
  make EXTRAVERSION=-${pkgrel}
}

package() {
  cd u-boot-${pkgver/rc/-rc}
  mkdir -p "${pkgdir}"/boot
  cp u-boot.imx "${pkgdir}"/boot
}
